package com.itheima.reggie.service.impl;

import com.itheima.reggie.entity.User;
import com.itheima.reggie.mapper.UserMapper;
import com.itheima.reggie.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired(required = false)
    private UserMapper userMapper;
    @Override
    public User login(User user) {
        User loginUser = userMapper.login(user);

        return loginUser;
    }

    @Override
    public Boolean add(User user) {
        Integer add = userMapper.add(user);
        return add>0;
    }

    @Override
    public User findById(Long id) {
        User byId = userMapper.findById(id);
        return byId;
    }
}
